package com.google.gwt.gfx.client.graphics.svg;

import com.google.gwt.user.client.Element;

/**
 * Utilities for SVG
 * 
 */
public final class SVG {

	public static final String NAMESPACE = "http://www.w3.org/2000/svg";

	public static final String VERSION = "1.1";

	/**
	 * @param name
	 *            a name space
	 * @return an element with name space
	 */
	public static native Element createElement(String name)
	/*-{
		return $doc.createElementNS("http://www.w3.org/2000/svg", name);
	}-*/;

	/**
	 * @param element
	 *            an element with properties
	 * @param name
	 *            key of attribute
	 * @return value of the attribute if exists
	 */
	public static native String getElementProperty(Element element, String name)
	/*-{
		return element.getAttributeNS(null, name);
	}-*/;

	/**
	 * @param element
	 *            element with properties.
	 * @param name
	 *            property name
	 * @param value
	 *            property value
	 */
	public static native void setElementProperty(Element element, String name,
			String value)
	/*-{
		element.setAttributeNS(null, name, value);
	}-*/;

	private SVG() {

	}

}
